<template>
    <div style="background-color: coral; width: 600px; margin: auto;">
        <h2>子组件</h2>
        <slot>默认内容</slot>
        <slot name="btn"></slot>
        <slot name="msg"></slot>
        <slot name="img" :scope="img"></slot>
    </div>
</template>

<script>
export default {
    data(){
        return{
            img:require('../assets/logo.png')
        }
    }
}
</script>